package Queue;

import java.util.*;

public class Test {
    public static void main(String[] args) {
        test1();
        test2();
    }
    public static void test1() {
        System.out.println("==============test1==============");
        Queue queue=new Queue();
        queue.offer(1);
        queue.offer(2);
        queue.offer(3);
        System.out.println(queue.poll());
        System.out.println(queue.poll());
        System.out.println(queue.peek());
        System.out.println("==============test2==============");
    }

    public static void test2() {
        java.util.Queue<Integer> queue=new java.util.LinkedList<>();
        queue.offer(1);
        queue.offer(2);
        queue.offer(3);
        queue.offer(4);
        System.out.println(queue.peek());
        queue.poll();
        System.out.println(queue.peek());
        queue.remove();
        System.out.println(queue.peek());
        System.out.println(queue.element());
    }
    public static void test3() {
        Deque<Integer> deque=new LinkedList<>();                          //表示用链表实现双端队列
        java.util.Queue<Integer> queue=new java.util.LinkedList<>();      //表示用链表实现队列
        java.util.LinkedList<Integer> stack=new LinkedList<>();           //表示用链表实现栈（头插头删）
        List<Integer> linkedlist=new java.util.LinkedList<>();            //表示双向链表
    }
    public static void test4() {
        Deque<Integer> deque1=new LinkedList<>();             //双端队列的链式实现
        Deque<Integer> deque2=new ArrayDeque<>();             //双端队列的顺序实现(ArrayDeque底层是一个数组)
        Stack<Integer> stack1=new Stack<>();                  //正常实现栈
        Deque<Integer> stack2=new ArrayDeque<>();             //顺序栈（比Stack用的多）
    }
}
